<?php 

 //fieldspec for fs_id

 //fieldspec for fs_id
$fieldspec["fs_id"] ["show"] = 1;
$fieldspec["fs_id"] ["key"] = 1;
$fieldspec["fs_id"] ["sort"] = 1;
$fieldspec["fs_id"] ["size"] = 20;
$fieldspec["fs_id"] ["rows"] = 1;
$fieldspec["fs_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["fs_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["fs_id"] ["source"] = "fieldspecs";
$fieldspec["fs_id"] ["edit_as"] = "ctl_text";

 //fieldspec for col_order

 //fieldspec for col_order
$fieldspec["col_order"] ["col_order"] = 1;
$fieldspec["col_order"] ["show"] = 1;
$fieldspec["col_order"] ["edit"] = 1;
$fieldspec["col_order"] ["sort"] = 1;
$fieldspec["col_order"] ["size"] = 20;
$fieldspec["col_order"] ["rows"] = 1;
$fieldspec["col_order"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["col_order"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["col_order"] ["source"] = "fieldspecs";
$fieldspec["col_order"] ["edit_as"] = "ctl_text";
$fieldspec["col_order"] ["add"] = 1;

 //fieldspec for crudset_id

 //fieldspec for crudset_id
$fieldspec["crudset_id"] ["col_order"] = 2;
$fieldspec["crudset_id"] ["show"] = 1;
$fieldspec["crudset_id"] ["edit"] = 1;
$fieldspec["crudset_id"] ["sort"] = 1;
$fieldspec["crudset_id"] ["size"] = 20;
$fieldspec["crudset_id"] ["rows"] = 1;
$fieldspec["crudset_id"] ["filter"] = 1;
$fieldspec["crudset_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["crudset_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["crudset_id"] ["source"] = "fieldspecs";
$fieldspec["crudset_id"] ["edit_as"] = "ctl_text";
$fieldspec["crudset_id"] ["add"] = 1;

 //fieldspec for variable_id

 //fieldspec for variable_id
$fieldspec["variable_id"] ["col_order"] = 3;
$fieldspec["variable_id"] ["show"] = 1;
$fieldspec["variable_id"] ["edit"] = 0;
$fieldspec["variable_id"] ["sort"] = 1;
$fieldspec["variable_id"] ["size"] = 20;
$fieldspec["variable_id"] ["rows"] = 1;
$fieldspec["variable_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["variable_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["variable_id"] ["source"] = "fieldspecs";
$fieldspec["variable_id"] ["edit_as"] = "ctl_text";
$fieldspec["variable_id"] ["listquery"] = "SELECT variable_id AS keyvalue, variable_name AS showvalue 
FROM variables JOIN tablesources ON variables.source_id = tablesources.tablesource_id 
JOIN crudsets ON crudsets.main_table = tablesources.tablesource_id  WHERE 1  ";

$fieldspec["variable_id"] ["listqueryparams"] = array('crudset_id');
$fieldspec["variable_id"] ["format_as"] = 'fmt_lookup';
$fieldspec["variable_id"] ["edit_as"] = 'ctl_select';
$fieldspec['variable_id'] ["add"] = 1;
$fieldspec["variable_id"] ["list"] [0] = array('keyvalue'=>0, 'showvalue'=>"NONE");

 //fieldspec for show

 //fieldspec for show
$fieldspec["show"] ["col_order"] = 4;
$fieldspec["show"] ["show"] = 1;
$fieldspec["show"] ["edit"] = 1;
$fieldspec["show"] ["sort"] = 1;
$fieldspec["show"] ["size"] = 20;
$fieldspec["show"] ["rows"] = 1;
$fieldspec["show"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["show"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["show"] ["source"] = "fieldspecs";
$fieldspec["show"] ["edit_as"] = "ctl_checkbox";
$fieldspec["show"] ["add"] = 1;

 //fieldspec for edit

 //fieldspec for edit
$fieldspec["edit"] ["col_order"] = 5;
$fieldspec["edit"] ["show"] = 1;
$fieldspec["edit"] ["edit"] = 1;
$fieldspec["edit"] ["sort"] = 1;
$fieldspec["edit"] ["size"] = 20;
$fieldspec["edit"] ["rows"] = 1;
$fieldspec["edit"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["edit"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["edit"] ["source"] = "fieldspecs";
$fieldspec["edit"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for key

 //fieldspec for key
$fieldspec["key"] ["col_order"] = 6;
$fieldspec["key"] ["show"] = 1;
$fieldspec["key"] ["edit"] = 1;
$fieldspec["key"] ["sort"] = 1;
$fieldspec["key"] ["size"] = 20;
$fieldspec["key"] ["rows"] = 1;
$fieldspec["key"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["key"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["key"] ["source"] = "fieldspecs";
$fieldspec["key"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for filter

 //fieldspec for filter
$fieldspec["filter"] ["col_order"] = 7;
$fieldspec["filter"] ["show"] = 1;
$fieldspec["filter"] ["edit"] = 1;
$fieldspec["filter"] ["sort"] = 1;
$fieldspec["filter"] ["size"] = 20;
$fieldspec["filter"] ["rows"] = 1;
$fieldspec["filter"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["filter"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["filter"] ["source"] = "fieldspecs";
$fieldspec["filter"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for sort

 //fieldspec for sort
$fieldspec["sort"] ["col_order"] = 8;
$fieldspec["sort"] ["show"] = 1;
$fieldspec["sort"] ["edit"] = 1;
$fieldspec["sort"] ["sort"] = 1;
$fieldspec["sort"] ["size"] = 20;
$fieldspec["sort"] ["rows"] = 1;
$fieldspec["sort"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["sort"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["sort"] ["source"] = "fieldspecs";
$fieldspec["sort"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for add

 //fieldspec for add
$fieldspec["add"] ["col_order"] = 9;
$fieldspec["add"] ["show"] = 1;
$fieldspec["add"] ["edit"] = 1;
$fieldspec["add"] ["sort"] = 1;
$fieldspec["add"] ["size"] = 20;
$fieldspec["add"] ["rows"] = 1;
$fieldspec["add"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["add"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["add"] ["source"] = "fieldspecs";
$fieldspec["add"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for showfilter

 //fieldspec for showfilter
$fieldspec["showfilter"] ["col_order"] = 25;
$fieldspec["showfilter"] ["show"] = 1;
$fieldspec["showfilter"] ["edit"] = 1;
$fieldspec["showfilter"] ["sort"] = 1;
$fieldspec["showfilter"] ["size"] = 20;
$fieldspec["showfilter"] ["rows"] = 1;
$fieldspec["showfilter"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["showfilter"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["showfilter"] ["source"] = "fieldspecs";
$fieldspec["showfilter"] ["edit_as"] = "ctl_checkbox";

 //fieldspec for size

 //fieldspec for size
$fieldspec["size"] ["col_order"] = 10;
$fieldspec["size"] ["show"] = 1;
$fieldspec["size"] ["edit"] = 1;
$fieldspec["size"] ["sort"] = 1;
$fieldspec["size"] ["size"] = 20;
$fieldspec["size"] ["rows"] = 1;
$fieldspec["size"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["size"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["size"] ["source"] = "fieldspecs";
$fieldspec["size"] ["edit_as"] = "ctl_text";

 //fieldspec for rows

 //fieldspec for rows
$fieldspec["rows"] ["col_order"] = 11;
$fieldspec["rows"] ["show"] = 1;
$fieldspec["rows"] ["edit"] = 1;
$fieldspec["rows"] ["sort"] = 1;
$fieldspec["rows"] ["size"] = 20;
$fieldspec["rows"] ["rows"] = 1;
$fieldspec["rows"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["rows"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["rows"] ["source"] = "fieldspecs";
$fieldspec["rows"] ["edit_as"] = "ctl_text";

 //fieldspec for headname

 //fieldspec for headname
$fieldspec["headname"] ["col_order"] = 12;
$fieldspec["headname"] ["show"] = 1;
$fieldspec["headname"] ["edit"] = 1;
$fieldspec["headname"] ["sort"] = 1;
$fieldspec["headname"] ["size"] = 20;
$fieldspec["headname"] ["rows"] = 1;
$fieldspec["headname"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["headname"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["headname"] ["source"] = "fieldspecs";
$fieldspec["headname"] ["edit_as"] = "ctl_text";

 //fieldspec for rawformat

 //fieldspec for rawformat
$fieldspec["rawformat"] ["col_order"] = 13;
$fieldspec["rawformat"] ["show"] = 1;
$fieldspec["rawformat"] ["edit"] = 1;
$fieldspec["rawformat"] ["sort"] = 1;
$fieldspec["rawformat"] ["size"] = 20;
$fieldspec["rawformat"] ["rows"] = 1;
$fieldspec["rawformat"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["rawformat"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["rawformat"] ["source"] = "fieldspecs";
$fieldspec["rawformat"] ["edit_as"] = "ctl_text";

 //fieldspec for image

 //fieldspec for image
$fieldspec["image"] ["col_order"] = 14;
$fieldspec["image"] ["show"] = 1;
$fieldspec["image"] ["edit"] = 1;
$fieldspec["image"] ["sort"] = 1;
$fieldspec["image"] ["size"] = 20;
$fieldspec["image"] ["rows"] = 1;
$fieldspec["image"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["image"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["image"] ["source"] = "fieldspecs";
$fieldspec["image"] ["edit_as"] = "ctl_text";

 //fieldspec for date_show_format

 //fieldspec for date_show_format
$fieldspec["date_show_format"] ["col_order"] = 15;
$fieldspec["date_show_format"] ["show"] = 1;
$fieldspec["date_show_format"] ["edit"] = 1;
$fieldspec["date_show_format"] ["sort"] = 1;
$fieldspec["date_show_format"] ["size"] = 20;
$fieldspec["date_show_format"] ["rows"] = 1;
$fieldspec["date_show_format"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["date_show_format"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["date_show_format"] ["source"] = "fieldspecs";
$fieldspec["date_show_format"] ["edit_as"] = "ctl_text";

 //fieldspec for date_source_format

 //fieldspec for date_source_format
$fieldspec["date_source_format"] ["col_order"] = 16;
$fieldspec["date_source_format"] ["show"] = 1;
$fieldspec["date_source_format"] ["edit"] = 1;
$fieldspec["date_source_format"] ["sort"] = 1;
$fieldspec["date_source_format"] ["size"] = 20;
$fieldspec["date_source_format"] ["rows"] = 1;
$fieldspec["date_source_format"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["date_source_format"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["date_source_format"] ["source"] = "fieldspecs";
$fieldspec["date_source_format"] ["edit_as"] = "ctl_text";

 //fieldspec for allowhtml

 //fieldspec for allowhtml
$fieldspec["allowhtml"] ["col_order"] = 17;
$fieldspec["allowhtml"] ["show"] = 1;
$fieldspec["allowhtml"] ["edit"] = 1;
$fieldspec["allowhtml"] ["sort"] = 1;
$fieldspec["allowhtml"] ["size"] = 20;
$fieldspec["allowhtml"] ["rows"] = 1;
$fieldspec["allowhtml"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["allowhtml"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["allowhtml"] ["source"] = "fieldspecs";
$fieldspec["allowhtml"] ["edit_as"] = "checkbox";

 //fieldspec for source

 //fieldspec for source
$fieldspec["source"] ["col_order"] = 18;
$fieldspec["source"] ["show"] = 1;
$fieldspec["source"] ["edit"] = 1;
$fieldspec["source"] ["sort"] = 1;
$fieldspec["source"] ["size"] = 20;
$fieldspec["source"] ["rows"] = 1;
$fieldspec["source"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["source"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["source"] ["source"] = "fieldspecs";
$fieldspec["source"] ["edit_as"] = "ctl_text";

 //fieldspec for makefunction

 //fieldspec for makefunction
$fieldspec["makefunction"] ["col_order"] = 19;
$fieldspec["makefunction"] ["show"] = 1;
$fieldspec["makefunction"] ["edit"] = 1;
$fieldspec["makefunction"] ["sort"] = 1;
$fieldspec["makefunction"] ["size"] = 20;
$fieldspec["makefunction"] ["rows"] = 1;
$fieldspec["makefunction"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["makefunction"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["makefunction"] ["source"] = "fieldspecs";
$fieldspec["makefunction"] ["edit_as"] = "ctl_text";

 //fieldspec for list

 //fieldspec for list
$fieldspec["list"] ["col_order"] = 20;
$fieldspec["list"] ["show"] = 1;
$fieldspec["list"] ["edit"] = 1;
$fieldspec["list"] ["sort"] = 1;
$fieldspec["list"] ["size"] = 20;
$fieldspec["list"] ["rows"] = 1;
$fieldspec["list"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["list"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["list"] ["source"] = "fieldspecs";
$fieldspec["list"] ["edit_as"] = "ctl_text";

 //fieldspec for listquery

 //fieldspec for listquery
$fieldspec["listquery"] ["col_order"] = 21;
$fieldspec["listquery"] ["show"] = 1;
$fieldspec["listquery"] ["edit"] = 1;
$fieldspec["listquery"] ["sort"] = 1;
$fieldspec["listquery"] ["size"] = 20;
$fieldspec["listquery"] ["rows"] = 1;
$fieldspec["listquery"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["listquery"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["listquery"] ["source"] = "fieldspecs";
$fieldspec["listquery"] ["edit_as"] = "ctl_text";

 //fieldspec for listqueryorder

 //fieldspec for listqueryorder
$fieldspec["listqueryorder"] ["col_order"] = 22;
$fieldspec["listqueryorder"] ["show"] = 1;
$fieldspec["listqueryorder"] ["edit"] = 1;
$fieldspec["listqueryorder"] ["sort"] = 1;
$fieldspec["listqueryorder"] ["size"] = 20;
$fieldspec["listqueryorder"] ["rows"] = 1;
$fieldspec["listqueryorder"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["listqueryorder"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["listqueryorder"] ["source"] = "fieldspecs";
$fieldspec["listqueryorder"] ["edit_as"] = "ctl_text";

 //fieldspec for format_as

 //fieldspec for format_as
$fieldspec["format_as"] ["col_order"] = 23;
$fieldspec["format_as"] ["show"] = 1;
$fieldspec["format_as"] ["edit"] = 1;
$fieldspec["format_as"] ["sort"] = 1;
$fieldspec["format_as"] ["size"] = 20;
$fieldspec["format_as"] ["rows"] = 1;
$fieldspec["format_as"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["format_as"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["format_as"] ["source"] = "fieldspecs";
$fieldspec["format_as"] ["edit_as"] = "ctl_text";

 //fieldspec for edit_as

 //fieldspec for edit_as
$fieldspec["edit_as"] ["col_order"] = 24;
$fieldspec["edit_as"] ["show"] = 1;
$fieldspec["edit_as"] ["edit"] = 1;
$fieldspec["edit_as"] ["sort"] = 1;
$fieldspec["edit_as"] ["size"] = 20;
$fieldspec["edit_as"] ["rows"] = 1;
$fieldspec["edit_as"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["edit_as"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["edit_as"] ["source"] = "fieldspecs";
$fieldspec["edit_as"] ["edit_as"] = "ctl_text";


//column settings for delete
$fieldspec['delete'] ['show'] = 1;
$fieldspec['delete'] ['size'] = 20;
$fieldspec['delete'] ['rows'] = 1;
$fieldspec['delete'] ['makefunction'] = 'make_delete';

 ?>